package com.sunjq.personalblog.service.impl;

import java.util.List;

import com.sunjq.personalblog.dao.ArticleDAO;
import com.sunjq.personalblog.domain.Article;
import com.sunjq.personalblog.service.ArticleService;

public class ArticleServiceImpl implements ArticleService{
	
	ArticleDAO articleDAO;

	public ArticleDAO getArticleDAO() {
		return articleDAO;
	}

	public void setArticleDAO(ArticleDAO articleDAO) {
		this.articleDAO = articleDAO;
	}

	@Override
	public List<Article> listArticles() {
		return articleDAO.findAll();
	}

	@Override
	public void publishArticle(Article a) {
		this.articleDAO.persist(a);
		
	}

}
